package com.ronan.imweb.utils;

import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Component;

/**
 * FileName    : com.withufuture.imweb.utils
 * Description :
 *
 * @author : ronan
 * @version : 1.0
 * Create Date : 2021/3/23 16:42
 **/
@Component
public class Consumer {

    @Autowired
    private KafkaTemplate<String,Object> kafkaTemplate;

    /** 离线消息 topic */
    private static final String OFFLINE_MESSAGE = "OFFLINE_MESSAGE";


    /** 离线消息前缀+accid */
    private static final String OFFLINE_MESSAGE_PREFIX = "OFFLINE_MESSAGE-";


    @KafkaListener(topics = {OFFLINE_MESSAGE})
    public void offlineMessage(ConsumerRecord<?,?> record) {

    }
}
